package com.atguigu.spzx.product.client;

import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.product.client.fallback.ProductClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "service-product" ,fallback = ProductClientFallback.class) // 服务器地址
public interface ProductClient {
    @PutMapping("/api/product/updateSkuSalesAndStockByOrderNo/{orderNo}")
    public Result updateSkuSalesAndStockByOrderNo(@PathVariable("orderNo")String orderNo);
    // 远程调用时 返回的是jackson处理后的json字符串，默认openfeign会使用LinkedHashMap接收数据
    @GetMapping("/api/product/findSkuById/{skuId}")
    public Result<ProductSku> findSkuById(@PathVariable("skuId")Long skuId);
}
